home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / tkerror.n < prev    next >
Text File  |  1994-09-20  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4. tkerror(n)                 Tk Commands                        7.0
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      tkerror - Command invoked to process background errors
  12.  
  13. SYNOPSIS
  14.      tkerror _m_e_s_s_a_g_e
  15. _________________________________________________________________
  16.  
  17.  
  18. DESCRIPTION
  19.      The tkerror command doesn't exist as built-in  part  of  Tk.
  20.      Instead, individual applications or users can define a tker-
  21.      ror command (e.g. as a Tcl procedure) if they wish to handle
  22.      background errors.
  23.  
  24.      A background error is one that  occurs  in  a  command  that
  25.      didn't  originate  with the application.  For example, if an
  26.      error occurs while executing a command specified with a bind
  27.      of  after  command,  then  it  is a background error.  For a
  28.      non-background error, the error can simply  be  returned  up
  29.      through  nested Tcl command evaluations until it reaches the
  30.      top-level code in the application; then the application  can
  31.      report  the  error  in whatever way it wishes.  When a back-
  32.      ground error occurs, the unwinding ends in  the  Tk  library
  33.      and there is no obvious way for Tk to report the error.
  34.  
  35.      When Tk detects a background error, it invokes  the  tkerror
  36.      command,  passing it the error message as its only argument.
  37.      Tk assumes that the application has implemented the  tkerror
  38.      command, and that the command will report the error in a way
  39.      that makes sense for the application.  Tk  will  ignore  any
  40.      result returned by the tkerror command.
  41.  
  42.      If another Tcl error occurs within the tkerror command  then
  43.      Tk reports the error itself by writing a message to stderr.
  44.  
  45.      The Tk script library includes a default  tkerror  procedure  |
  46.      that  posts  a  dialog  box containing the error message and  |
  47.      offers the user a chance to see a  stack  trace  that  shows  |
  48.      where the error occurred.
  49.  
  50.  
  51. KEYWORDS
  52.      background error, reporting
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Tk                                                              1
  64.  
  65.  
  66.  
  67.